package com.pb.service.boot.config;

import com.plumelog.trace.aspect.AbstractAspect;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 *  plumelog 跟踪码添加事务链路追踪
 * @author liudebao
 * @date 20230615
 */
@Aspect
@Component
public class AspectConfig extends AbstractAspect {
    // 写你需要生成链路的业务包路劲
    @Around(value = "within(com.pb.infra.auth..*)")
    public Object around1(JoinPoint joinPoint) throws Throwable {
        return aroundExecute(joinPoint);
    }

    @Around(value = "within(com.pb.infra.dynamicSetting..*)")
    public Object around2(JoinPoint joinPoint) throws Throwable {
        return aroundExecute(joinPoint);
    }

    @Around(value = "within(com.pb.infra.param..*)")
    public Object around3(JoinPoint joinPoint) throws Throwable {
        return aroundExecute(joinPoint);
    }

    @Around(value = "within(com.pb.infra.taskManage..*)")
    public Object around4(JoinPoint joinPoint) throws Throwable {
        return aroundExecute(joinPoint);
    }

    @Around(value = "within(com.pb.metadata..*)")
    public Object around5(JoinPoint joinPoint) throws Throwable {
        return aroundExecute(joinPoint);
    }

    @Around(value = "within(com.pb.wkflow..*)")
    public Object around6(JoinPoint joinPoint) throws Throwable {
        return aroundExecute(joinPoint);
    }

}
